import request from '@/utils/request';

export async function getOrderList(page) {
  return await request.post('/api/1.0/department/order/search', {
    // applicationState: '2',
    pageCurrent: page
  });
}

export async function getCorpOrderList(companyId, page) {
  return await request.post('/api/1.0/department/order/search', {
    companyId: companyId,
    // applicationState: '2',
    pageCurrent: page
  });
}

export async function getOrderInfo3001(orderType) {
  return await request.post('/api/1.0/base/s901060parameter/list', {
    configTypeId: orderType,
    delFlag: 0,
    pageLimit: 1000
  });
}

export async function getOrderInfo3002() {
  return await request.post('/api/1.0/base/m812050cbinfo/list', {
    delFlag: 0,
    pageLimit: 5000
  });
}

//港口查询
export async function getOrderInfo3003() {
  return await request.post('/api/1.0/base/M812060PtInfoCustom/list', {
    delFlag: 0,
    pageLimit: 5000
  });
}

export async function getOrderSearch(
  beginDate,
  endDate,
  foreignCountry,
  arrivalCountry,
  portDestination,
  page
) {
  return await request.post('/api/1.0/department/order/search', {
    beginDate: beginDate,
    endDate: endDate,
    // applicationState: '2',
    foreignCountry: foreignCountry,
    arrivalCountry: arrivalCountry,
    portDestination: portDestination,
    pageCurrent: page
  });
}

export async function getOrderConditionSearch(start, end, condition, page) {
  return await request.post('/api/1.0/department/order/search', {
    beginDate: start,
    endDate: end,
    // applicationState: '2',
    conditionId: condition,
    pageCurrent: page
  });
}

export async function getOrderInfoPost(orderID) {
  return await request.post('/api/1.0/department/order/info', {
    id: orderID
  });
}
